using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BulletBag : MonoBehaviour
{
    public int bulletCount = 10;

    void OnTriggerEnter2D(Collider2D other)
    {
        PlayerController pc = other.GetComponent<PlayerController>();
        if (pc != null ) 
            {
            if(pc.MyCurrentBulletCount<pc.MyMaxBulletCount)
            {
                pc.ChangeBulletCount(bulletCount);
                Destroy(this.gameObject);
            }
            }
    }
}
